import { createRouter, createWebHashHistory, createWebHistory, RouteRecordRaw } from 'vue-router'
import { useAuthSotre } from '../sotre/authStore'
import { storeToRefs } from 'pinia'
import { useMenuStore } from '../sotre/useMenuSotre'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Layout',
    component: () => import('../views/Layout.vue'),
    children: [
      {
        path: '/dashboard',
        name: 'dashboard',
        meta: {
          keepAlive: false
        },
        component: () => import('../views/dashboard/Index.vue')
      },
      {
        path: '/editor-demo',
        name: 'demo',
        meta: {
          keepAlive: false
        },
        component: () => import('../views/EditorDemo.vue')
      },
    ]
  },
  {
    path: '/login',
    name: 'Login',
    meta: {
      keepAlive: false
    },
    component: () => import('../views/Login.vue')
  },
  {
    path: '/wechatLogin',
    name: 'wechatLogin',
    meta: {
      keepAlive: false
    },
    component: () => import('../views/wechat/wechatLogin.vue')
    
  },
  {
    path: '/asyncComponent',
    name: 'asyncComponent',
    meta: {
      keepAlive: false
    },
    component: () => import('../views/async/AsyncComponent.vue')
    
  },
  {
    path: '/keepalive',
    name: 'keepAlive',
    meta: {
      keepAlive: true
    },
    component: () => import('../views/keepAlive/KeepAlive.vue')
    
  },
  {
    path: '/keepedit',
    name: 'keepedit',
    component: () => import('../views/keepAlive/keepEdit.vue')
    
  },
  {
    path: '/scheduledemo',
    name: 'scheduleDemo',
    component: () => import('../views/scheduleDemo.vue')
    
  },
  {
    path: '/directive',
    name: 'Directive',
    component: () => import('../views/directive/Directive.vue')
    
  },
  {
    path: '/map',
    name: 'Map',
    component: () => import('../views/map/Map.vue')
    
  },
  {
    path: "/:pathMatch(.*)*",
    component: () => import("../views/404.vue"),
    meta: { hidden: true },
 }


]

const router = createRouter({
  history: createWebHistory("/2406care/ldq/"),
  routes
})

export default router